
import { _decorator, Component, Node, Sprite } from 'cc';
import { PopManager } from '../manager/PopManager';
import { AppControll, PopView } from '../manager/AppControll';
import { SoundManager } from '../manager/SoundManger';
const { ccclass, property } = _decorator;

export enum GameState {
    default,
    ready,
    start
}

export enum CEventName {
    MoveFinish = "MoveFinish",
    HpEmpty = "HpEmpty"
}

export type DamageStruct = {
    isCriticalHit: boolean, //是否是暴击
    damage: number,//伤害
    time: number// 爆发的时间 延迟执行
}

export enum GameModel {
    normal,
    levelModel,
}

@ccclass('FightControl')
export class FightControl extends Component {
    @property(Node)
    mFightView: Node = null;
    @property(Node)
    mMenuView: Node = null;

    static gameState: GameState = GameState.default
    static gamemodel: GameModel = GameModel.normal;
    static nCurLevel: number = null;
    private mNdSetting: Node = null;

    protected onLoad(): void {
        this.mNdSetting = this.node.getChildByName("settings").getChildByName("settingBtn");
        this.mNdSetting.on(Node.EventType.TOUCH_END, this.OnSetTouch, this);
    }

    OnSetTouch() {
        AppControll.ShelvedTime = 0;
        SoundManager.Instance<SoundManager>().PlayEffect("ui/click");
        PopManager.Instance<PopManager>().ShowPop(PopView.setting);
    }

    InitView() {

    }

    RegisteredEvent() {

    }

    OnTouchStart() {

    }

    OnTouchMove() {

    }

    OnTouchEnd() {

    }

    OnTouchCancel() {

    }

    start() {
        // [3]
    }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.4/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.4/manual/zh/scripting/decorator.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.4/manual/zh/scripting/life-cycle-callbacks.html
 */
